import math

A=float(input())

def fi(x):
    return (x+A/x)/2

def newton(x,max_times,error):
    cnt=0
    while 1==1:
        cnt+=1
        #new_x = round(fi(x),5)
        new_x=fi(x)

        if math.fabs(new_x-x)<error or cnt==max_times:
            break
        x=new_x
        print("%.5f %d" % (x, cnt))
    print("%.5f %d" % (x, cnt))


newton(A,500,0.00001)


